﻿<?php
//单入口

define('CONT_PATH','protected/controller/');//控制器方向常量
define('MODEL_PATH','protected/model/');//数据方向常量
define('VIEW_PATH','protected/view/');//视图方向常量
$data=date('md',time());			//时间
define('ROOT_PATH','http://localhost/'.$data.'/');//验证码动态常量

include(MODEL_PATH.'db_fun.php');//连接数据库封装的函数
include(MODEL_PATH.'page.php');//分页
include(MODEL_PATH.'init.php');//初始化
include(MODEL_PATH.'test.php');//字符串截取
include(MODEL_PATH.'img_fun.php');//图片处理

//$admin=!empty($_GET['admin'])?'admin':'home';//判断进前台还是后台
//$c=!empty($_GET['c'])?$_GET['c']:'index';//判断进入的模块
//$a=!empty($_GET['a'])?$_GET['a']:'index';//判断进入的程序、方法

$admin='admin';//进后台cms
$c='admin';
$a='login';

define('ADMIN',$admin);
define('A',$a);
define('C',$c);

include(MODEL_PATH.'level_fun.php');//权限

if(!empty($_GET['admin'])==1 && empty($_SESSION['admin']) && $a!='login'){echo "<script>alert('请先登录！');location='index.php?admin=1&c=admin&a=login';</script>";}
include(CONT_PATH.ADMIN.'/'.C.'/'.A.'.php');//连接登陆
?>